from fastapi import FastAPI
from 华为自动登入 import get_huawei_adgroup_page656, get_huawei_campaign_page, get_huawei_adgroup_page168
from slider import *

app = FastAPI()

@app.get("/adgroup")
def read_root():
    res = get_huawei_adgroup_page656();
    return res

@app.get("/adgroupNext")
def read_root():
    res = get_huawei_adgroup_page168();
    return res

@app.get("/campaign")
def read_root():
    res = get_huawei_campaign_page();
    return res

@app.get("/test", summary="测试接口连通性")
async def test():
    dddd_test()

@app.get("/sliderTest", summary="滑块测试")
async def test():
    result = []
    res1 = login_with_slider()
    res2 = login_with_slider168();
    result.append(res1)
    result.append(res2)
    return result

@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
    return {"item_id": item_id, "q": q}